<{include file="../templates/admin/header.html"}>
<script type="text/javascript" src="js/test.js">
</script>

<div class="main-div">
<{if $judge eq 'add'}>
<form method="post" action="attributeCat.php?act=insert" name="theForm"  onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label">属性名称：</td>
    <td><input type="text" name="attr_name" maxlength="60" size = "30" value="" /></td>
  </tr>
  <tr>
    <td class="label">所属商品类型：</td>
    <td>
      <select name="cat_id">
        <option value="0" selected="selected">请选择...</option>
        <{foreach from=$cat_list item=cat}>
        <option value="<{$cat.cat_id}>"><{$cat.cat_name}></option>
        <{/foreach}>
      </select>
    </td>
  </tr>
  <tr>
    <td class="label">能否进行检索：</td>
	<td>
    <input type="radio" name="attr_index" value="0" checked="true">不需要检索
    <input type="radio" name="attr_index" value="1">关键字检索
    <input type="radio" name="attr_index" value="2">范围检索
	</td>
  </tr>
    <tr>
    <td class="label">相同属性的商品是否关联：</td>
    <td>
      <input type="radio" name="is_linked" value="0" checked="true" />否
      <input type="radio" name="is_linked" value="1"/>是
    </td>
  </tr>
  <tr>
    <td class="label">属性是否可选：</td>
    <td>
    <input type="radio" name="attr_type" value="0" checked="true" />唯一属性
    <input type="radio" name="attr_type" value="1">单选属性
    <input type="radio" name="attr_type" value="2">复选属性
    </td>
  </tr>
  <tr>
    <td class="label">该属性值得录入方式：</td>
    <td>
    <input type="radio" name="attr_input_type" value="0" checked="true" />手工录入
    <input type="radio" name="attr_input_type" value="1">从下面列表中选择（一行代表一个可选值)
    <input type="radio" name="attr_input_type" value="2">多行文本框
    </td>
  </tr>
  <tr>
    <td class="label">可选值列表</td>
    <td><textarea  name="attr_values" cols="30" rows="4"></textarea></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><br />
      <input type="submit" class="button" value="确定" />
      <input type="reset" class="button" value="重置" />
    </td>
  </tr>
</table>
</form>
<{/if}>
<{if $judge eq 'edit'}>
<form method="post" action="attributeCat.php?act=update&attr_id=<{$attr_id}>" name="theForm"  onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label">属性名称：</td>
    <td><input type="text" name="attr_name" maxlength="60" size = "30" value="<{$attr_row.attr_name}>" /></td>
  </tr>
  <tr>
    <td class="label">所属商品类型：</td>
    <td>
      <select name="cat_id">
        <option value="0" selected="selected">请选择...</option>
        <{foreach from=$cat_list item=cat}>
        <option value="<{$cat.cat_id}>" <{if $cat.cat_id eq $cat_id}>selected="selected"<{/if}> ><{$cat.cat_name}></option>
        <{/foreach}>
      </select>
    </td>
  </tr>
  <tr>
    <td class="label">能否进行检索：</td>
	<td>
    <input type="radio" name="attr_index" value="0" <{if $attr_row.attr_index eq 0}>checked="true"<{/if}> />不需要检索
    <input type="radio" name="attr_index" value="1" <{if $attr_row.attr_index eq 1}>checked="true"<{/if}> />关键字检索
    <input type="radio" name="attr_index" value="2" <{if $attr_row.attr_index eq 2}>checked="true"<{/if}> />范围检索
	</td>
  </tr>
    <tr>
    <td class="label">相同属性的商品是否关联：</td>
    <td>
      <input type="radio" name="is_linked" value="0" <{if $attr_row.is_linked eq 0}>checked="true"<{/if}> />否
      <input type="radio" name="is_linked" value="1" <{if $attr_row.is_linked eq 1}>checked="true"<{/if}> />是
    </td>
  </tr>
  <tr>
    <td class="label">属性是否可选：</td>
    <td>
    <input type="radio" name="attr_type" value="0" <{if $attr_row.attr_type eq 0}>checked="true"<{/if}> />唯一属性
    <input type="radio" name="attr_type" value="1" <{if $attr_row.attr_type eq 1}>checked="true"<{/if}> />单选属性
    <input type="radio" name="attr_type" value="2" <{if $attr_row.attr_type eq 2}>checked="true"<{/if}> />复选属性
    </td>
  </tr>
  <tr>
    <td class="label">该属性值得录入方式：</td>
    <td>
    <input type="radio" name="attr_input_type" value="0" <{if $attr_row.attr_input_type eq '手工录入'}>checked="true"<{/if}> />手工录入
    <input type="radio" name="attr_input_type" value="1" <{if $attr_row.attr_input_type eq '列表中选择'}>checked="true"<{/if}> />从下面列表中选择（一行代表一个可选值)
    <input type="radio" name="attr_input_type" value="2" <{if $attr_row.attr_input_type eq '多行文本框'}>checked="true"<{/if}> />多行文本框
    </td>
  </tr>
  <tr>
    <td class="label">可选值列表</td>
    <td><textarea  name="attr_values2" cols="30" rows="4"></textarea></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><br />
      <input type="hidden" id="attr" value="<{$attr_row.attr_values}>"/>
      <input type="submit" class="button" value="确定" />
      <input type="reset" class="button" value="重置" />
    </td>
  </tr>
</table>
</form>
<{/if}>
</div>

</body>
</html>